import { request } from "@/utils/service"
import { getToken } from "@/utils/cache/cookies"
import axios from "axios"
const baseURL = import.meta.env.VITE_BASE_API
export function getRiskControlCenterApi(params: any) {
  return request({
    url: "/risk/queryPage",
    method: "get",
    params
  })
}
// 增加
export function addRiskControlCenterApi(data: any) {
  return request({
    url: "/risk/add",
    method: "post",
    data
  })
}
/** 改 */
export function updateRiskControlCenterApi(data: any) {
  return request({
    url: "/risk/update",
    method: "put",
    data
  })
}

//根据身份证号查询
export function getRiskByCardIdApi(params: any) {
  return request({
    url: "/risk/queryByCardId",
    method: "get",
    params
  })
}

// 查询高危拦截订单
export function getRiskOrderApi(params: any) {
  return request({
    url: "risk/order/queryPage",
    method: "get",
    params
  })
}
//导出
export function downLoaRiskTable(data: any) {
  return axios({
    url: `${baseURL}/risk/riskExport`,
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data,
    responseType: "blob"
  })
}
